package com.hsc.yalebao.base;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebSettings.LayoutAlgorithm;
import android.webkit.WebSettings.PluginState;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;

@SuppressLint({"SetJavaScriptEnabled"})
public class HtmlActivity extends BaseActivity
  implements View.OnClickListener
{
  private WebView mCotentWebView;
  private Handler mHandler = new Handler();
  private ProgressBar mPb;
  private int mType = 0;
  private String mUrl = "";
  View.OnClickListener onClickListener = new View.OnClickListener()
  {
    public void onClick(View paramAnonymousView)
    {
      switch (paramAnonymousView.getId())
      {
      default:
        return;
      case 2131099699:
      }
      CustomApplication.app.finishActivity(HtmlActivity.this);
    }
  };
  private TextView tv_title;

  private void initData()
  {
    this.mCotentWebView.setWebViewClient(new WebViewClient()
    {
      public void onPageFinished(WebView paramAnonymousWebView, String paramAnonymousString)
      {
        super.onPageFinished(paramAnonymousWebView, paramAnonymousString);
      }

      public boolean shouldOverrideUrlLoading(final WebView paramAnonymousWebView, final String paramAnonymousString)
      {
        if ((paramAnonymousString != null) && ("tel".equals(paramAnonymousString.substring(0, 3))))
        {
          localIntent = new Intent("android.intent.action.DIAL", Uri.parse(paramAnonymousString));
          localIntent.setFlags(268435456);
          HtmlActivity.this.startActivity(localIntent);
        }
        while ((paramAnonymousString == null) || (!paramAnonymousString.startsWith("http")))
        {
          Intent localIntent;
          return true;
        }
        HtmlActivity.this.mHandler.post(new Runnable()
        {
          public void run()
          {
            paramAnonymousWebView.loadUrl(paramAnonymousString);
          }
        });
        return true;
      }
    });
    this.mHandler.post(new Runnable()
    {
      public void run()
      {
        HtmlActivity.this.mCotentWebView.loadUrl(HtmlActivity.this.mUrl);
      }
    });
  }

  public void init()
  {
    Bundle localBundle = getIntent().getExtras();
    if (localBundle != null)
    {
      this.mUrl = localBundle.getString("url");
      this.mType = localBundle.getInt("type", 0);
    }
    if (this.mType == -1)
      setTitle(8, 8, 0, "", 8, 8, 0);
    while (true)
    {
      setTitle(8, 0, 2130837809, "", 8, 8, 0);
      this.mCotentWebView = ((WebView)findViewById(2131099859));
      this.mPb = ((ProgressBar)findViewById(2131099858));
      this.mPb.setMax(100);
      this.mCotentWebView.setScrollBarStyle(33554432);
      this.mCotentWebView.getSettings().setLoadWithOverviewMode(true);
      this.mCotentWebView.getSettings().setPluginState(WebSettings.PluginState.ON);
      this.mCotentWebView.getSettings().setLoadsImagesAutomatically(true);
      this.mCotentWebView.getSettings().setJavaScriptEnabled(true);
      this.mCotentWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
      this.mCotentWebView.getSettings().setSupportMultipleWindows(true);
      this.mCotentWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
      this.mCotentWebView.getSettings().setDomStorageEnabled(true);
      this.mCotentWebView.getSettings().setAllowFileAccess(true);
      this.mCotentWebView.getSettings().setAppCacheEnabled(true);
      this.mCotentWebView.getSettings().setSupportZoom(true);
      this.mCotentWebView.getSettings().setBuiltInZoomControls(true);
      this.mCotentWebView.getSettings().setUseWideViewPort(true);
      this.mCotentWebView.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
      this.mCotentWebView.getSettings().supportMultipleWindows();
      this.mCotentWebView.getSettings().setNeedInitialFocus(true);
      this.mCotentWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
      this.mCotentWebView.getSettings().setLoadsImagesAutomatically(true);
      this.mCotentWebView.getSettings().setDefaultTextEncodingName("utf-8");
      this.mCotentWebView.setWebChromeClient(new WebChromeClient()
      {
        public void onProgressChanged(WebView paramAnonymousWebView, int paramAnonymousInt)
        {
          HtmlActivity.this.mPb.setVisibility(0);
          HtmlActivity.this.mPb.setProgress(paramAnonymousInt);
          if (paramAnonymousInt == 100)
            HtmlActivity.this.mPb.setVisibility(8);
          super.onProgressChanged(paramAnonymousWebView, paramAnonymousInt);
        }

        public void onReceivedTitle(WebView paramAnonymousWebView, String paramAnonymousString)
        {
          super.onReceivedTitle(paramAnonymousWebView, paramAnonymousString);
          Log.e("ANDROID_LAB", "TITLE=" + paramAnonymousString);
          HtmlActivity.this.tv_title.setText(paramAnonymousString);
        }
      });
      initData();
      return;
      setTitle(8, 0, 2130837809, "", 8, 8, 0);
    }
  }

  public void onClick(View paramView)
  {
    paramView.getId();
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903059);
    init();
  }

  public void onDestroy()
  {
    super.onDestroy();
  }

  public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  {
    if ((paramInt == 4) && (this.mCotentWebView.canGoBack()))
    {
      this.mCotentWebView.goBack();
      return true;
    }
    return super.onKeyDown(paramInt, paramKeyEvent);
  }

  public void setTitle(int paramInt1, int paramInt2, int paramInt3, String paramString, int paramInt4, int paramInt5, int paramInt6)
  {
    View localView = findViewById(2131099716);
    this.tv_title = ((TextView)localView.findViewById(2131099701));
    this.tv_title.setText(paramString);
    ((TextView)localView.findViewById(2131099700)).setVisibility(paramInt1);
    ImageView localImageView1 = (ImageView)localView.findViewById(2131099699);
    localImageView1.setVisibility(paramInt2);
    localImageView1.setOnClickListener(this.onClickListener);
    localImageView1.setImageResource(paramInt3);
    TextView localTextView = (TextView)localView.findViewById(2131099702);
    localTextView.setVisibility(paramInt4);
    localTextView.setOnClickListener(this.onClickListener);
    ImageView localImageView2 = (ImageView)localView.findViewById(2131099704);
    localImageView2.setVisibility(paramInt5);
    localImageView2.setImageResource(paramInt6);
    if (this.mType == -1)
    {
      localView.setVisibility(8);
      return;
    }
    localView.setVisibility(0);
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.base.HtmlActivity
 * JD-Core Version:    0.6.2
 */